package com.ruoyi.dm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.dm.domain.GpsTargetInfoDetailVO;
import com.ruoyi.dm.domain.po.GpsTargetInfoPO;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface GpsTargetInfoMapper extends BaseMapper<GpsTargetInfoPO> {


    @Results({
            @Result(column = "name",property = "structs",many = @Many(select = "com.ruoyi.dm.mapper.GpsTargetStructInfoMapper.listByMasterCode")),
            @Result(column = "name",property = "name")
    }
    )
    @Select("select name,code,quality,create_date as createDate,MATRIX from COLLECT_GPS_INFO where id =#{id}")
    GpsTargetInfoDetailVO detail(@Param("id") Long id);

    @Results({
            @Result(column = "name",property = "structs",many = @Many(select = "com.ruoyi.dm.mapper.GpsTargetStructInfoMapper.listByMasterCode")),
            @Result(column = "name",property = "name")
    }
    )
    @Select("select name,code,quality,create_date as createDate,MATRIX from COLLECT_GPS_INFO")
    List<GpsTargetInfoPO> listDetail();
}
